package ysq.xyg.web.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@Table(name = "xyg_web_config")
public class WebConfig implements Serializable{

	/**
     * 主键
     */
	@Id
	private String id;

	/**
     * 应用主键
     */
	@Column(name = "account_id")
	private String accountId;

	/**
     * 网站名称
     */
	@Column(name = "name")
	private String name;

	/**
	 * 网站图片
	 */
	@Column(name = "image")
	private String image;

	/**
	 * 首页配置图片
	 */
	@Column(name = "index_image")
	private String indexImage;

	/**
	 * 价格描述
	 */
	@Column(name = "price_msg")
	private String priceMsg;

	/**
	 * 协议名称
	 */
	@Column(name = "agree_name")
	private String agreeName;

	/**
	 * 协议内容
	 */
	@Column(name = "agree_content")
	private String agreeContent;

	/**
     * 配置 预约模式1=按需订单分配2=抢单分配3=管理员分配
	 * recovery_dync_type
     */
	@Column(name = "recovery_type")
	private String recoveryType;

	/**
     * 创建者
     */
	@Column(name = "create_user")
	private String createUser;

	/**
     * 更新者
     */
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 删除状态1、未删除2、已删除
     */
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建时间
     */
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 更新时间
     */
	@Column(name = "update_time")
	private Date updateTime;

	@Column(name = "host_manage_phone")
	private String hostManagePhone;

	public WebConfig(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.accountId = sysUser.getAccountId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}